The present invention relates to a multiprocessor system and an interprocessor communication scheme suitable for reducing CPU overheads of interprocessor communication.
In one scheme for communication between a plurality of subsystems each comprising a main memory and an instruction processing device, such communication is performed by using a channel coupling device in the same way as communication between the input and output as described in JP-A-60-84658. When this scheme is used, the overhead of a processor required for communication becomes large. In another scheme such as that described hereafter, therefore, a shared memory device, which is accessible by a processor instruction, is provided separately from a main memory, and the shared memory device is shared among a plurality of subsystems and used as a communication buffer.
In a scheme described in JP-A-58-56063, a shared memory device for communication is provided in a system supervisory device and divided into communication buffers associated with respective subsystems. As for the send operation, an operating system (hereafter abbreviated to OS) requested by a program of the send side writes communication data into a communication buffer so provided in the shared memory device as to be associated with a subsystem of the other party. The communication data includes a communication message (hereafter referred to simply as a message) to be conveyed from a send program to a receive program and discriminating information between the program of the send side and the program of the receive side. The system supervisory device generates an interrupt with respect to the subsystem of the other party. As for the receive operation, the OS within the subsystem of the other party which has received the interrupt reads the communication data out of the communication buffer, decodes the discriminating information and conveys the message to the program of the receive side.
In a scheme described in JP-A-60-237566, a part of the shared memory device is divided into communication buffers respectively associated with subsystems and those communication buffers are provided beforehand with respective addresses. As for the send operation, the OS requested by a program of the send side writes communication data (such as the message and the discriminating information) into a communication buffer so provided in the shared memory device as to be associated with the subsystem of the other party and makes another means generate an interrupt with respect to the subsystem of the other party. As for the receive operation, the OS included in the subsystem of the other party which has received an interrupt reads communication data out of a communication buffer associated with its own subsystem and conveys a message included in the communication data to a program of the receive side specified by discriminating information contained in the communication data thus read out. Further, the OS of the receive side writes a specific pattern into a subsystem thereof to inform a subsystem of the send side that the communication data has been received.
The above described prior art has problems hereafter described.
(1) In the subsystem, a plurality of programs collected by the OS are activated. Discriminating information for specifying the send program and the receive program and a message to be transferred between those programs are mixedly contained in the communication data. Therefore, the OS of the subsystem of the receive side must read once the communication data out of the shared memory device into the main memory device included in that subsystem, decode the discriminating information, and inform the program of the receive side controlled by that OS of the discriminating information thus decoded. Since the communication buffer included in the shared memory device must be released early for the next communication, however, the OS must transfer the message portion of the communication data to the main memory device. That is to say, the OS of the receive side must read the communication data stored in the shared memory device into an area included in the main memory device and allocated to the OS and then transfer the communication data thus read out to an area of the main memory device specified by discriminating information contained in that communication data and allocated to the receive program. A transfer comprising two stages thus becomes necessary, resulting in an increased CPU overhead of communication processing.
(2) The communication buffer which is a part of the shared memory device has a fixed size. In case communication data (comprising a message and discriminating information) and having a larger size than that of the communication buffer is to be transferred, therefore, that communication data must be divided by the program of the send side into parts each having the size of the communication buffer and a plurality of communication operations must thus be performed. Therefore, the CPU overhead of the subsystem of the send side and the subsystem of the receive side for communication increases with the number of communication operations.
On the other hand, an increase in the number of communication operations can be prevented by preparing beforehand an area, which is sufficiently larger than various communication data, as a communication buffer. Since a portion which is not actually used is produced in the shared memory device, however, the efficiency of utilization of the shared memory device is lowered.
(3) Further, if each subsystem has one communication buffer as described in JP-A-60-237556, the above described plurality of communication operations must be performed one after another. That is to say, the communication buffer is occupied by a single communication operation. Therefore, the subsystem of the send side cannot get into the next communication operation until it is confirmed that the subsystem of the receive side has received the message. As a result, the time required for communication is prolonged.
Further, even if a plurality of communication operations are not obtained as a result of dividing a single communication as described above but comprise a large number of independent communication operations, which are respectively different in combination of programs at the send side and the receive side but are the same in subsystems at the send side and the receive side, the communication operations are performed one after another in the same way, resulting in a prolonged communication time.
(4) Further, if the communication operations are performed one after another as described above, a plurality of communication operations have a wait. Therefore, control of the resultant queue becomes necessary in the subsystem of the send side. That is to say, in case the OS of a subsystem is requested to send by a plurality of programs in that subsystem one after another, the OS must keep a second operation and succeeding operations waiting in order during the first communication operation by making a queue, for example, and must perform control so that the second communication operation may be started upon termination of the first communication operation. Therefore, the CPU overhead for queue control increases.